package com.itheima;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @auther Macrydy
 * @date 2020/7/8 9:16
 */
public class CallableTest {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        MyCallable callable = new MyCallable();
        FutureTask<String> futureTask = new FutureTask<String>(callable);
        Thread thread = new Thread(futureTask);
        thread.start();
        String s = futureTask.get();
        System.out.println(s);
    }
}
